package com.demo.service.impl;

import com.demo.dao.FuncVODao;
import com.demo.service.FuncVOService;
import com.demo.vo.Function;
import com.demo.vo.FuncVOSeacherInfo;
import com.demo.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class FuncVOServiceImpl implements FuncVOService {

    @Autowired
    FuncVODao funcVODao;

    @Override
    public List<Function> getFuncList(FuncVOSeacherInfo info){
        return funcVODao.getFuncList((info.getPage()-1)*info.getLimit(),
                info.getLimit(),info.getFuncId(),info.getModId(),info.getPrjId(),info.getUserId());
    }

    @Override
    public int getFuncCount(FuncVOSeacherInfo info){
        return funcVODao.getFuncCount(info);
    }

    @Override
    public int addFunc(Function function){
        return funcVODao.addFunc(function);
    }

    @Override
    public int deleteFunc(String funcId){
        return funcVODao.deleteFunc(funcId);
    }

    @Override
    public int updateFunc(Function function){
        return funcVODao.updateFunc(function);
    }

    @Override
    public List<User> getUserListByuserType(String userType){
        return funcVODao.getUserListByuserType(userType);
    }
}
